home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / bbs / cddk9606.zip / HEADERS.ARJ / CONCERTO.INT next >
Text File  |  1996-06-14  |  16KB  |  503 lines

  1.  
  2. { ───────────────────────────────────────────────────────────────────────── }
  3. {  CONCERTO: The Concerto Door Development Kit (Central Unit)               }
  4. {  Copyright 1996 David Pinch ∙ All Rights Reserved Worldwide               }
  5. { ───────────────────────────────────────────────────────────────────────── }
  6.  
  7. UNIT Concerto;
  8.  
  9. {$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
  10. {$F+} { . . . . . . . . . . . . . . . . . . . .  Force far calls for safety }
  11. {$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
  12. {$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
  13. {$Q-} { . . . . . . . . . . . . . .  Do not generate overflow-checking code }
  14. {$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
  15. {$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
  16. {$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
  17.  
  18. INTERFACE
  19.  
  20. USES
  21.   IO, Objects, Scripts, xStrings;
  22.  
  23. TYPE
  24.  
  25.   tFOSSIL = OBJECT(tIODriverRemote)
  26.  
  27.     CONSTRUCTOR Init(p:pChar; c:Word; b,l:LongInt);
  28.  
  29.     FUNCTION  CarrierDetect:Boolean;  VIRTUAL;
  30.     PROCEDURE LowerDTR;               VIRTUAL;
  31.     PROCEDURE PurgeInbound;           VIRTUAL;
  32.     PROCEDURE PurgeOutbound;          VIRTUAL;
  33.     PROCEDURE RaiseDTR;               VIRTUAL;
  34.     PROCEDURE ReadChar(VAR c:Char);   VIRTUAL;
  35.     PROCEDURE SendChar(c:Char);       VIRTUAL;
  36.     FUNCTION  Waiting:Boolean;        VIRTUAL;
  37.  
  38.     DESTRUCTOR Done;                  VIRTUAL;
  39.  
  40.     END;
  41.  
  42.   pFOSSIL = ^tFOSSIL;
  43.  
  44.   tSysKey = OBJECT(tObject)
  45.     ScanCode : Word;
  46.     Script   : pChar;
  47.     CONSTRUCTOR Init(Code:Word; Source:pChar);
  48.     DESTRUCTOR Done; VIRTUAL;
  49.     END;
  50.  
  51.   pSysKey = ^tSysKey;
  52.  
  53.   tLocalIO = OBJECT(tIODriver)
  54.  
  55.     SysKeySet : pCollection;
  56.  
  57.     CONSTRUCTOR Init(p:pChar);
  58.  
  59.     PROCEDURE ClrEOL;                         VIRTUAL;
  60.     PROCEDURE ClrScr;                         VIRTUAL;
  61.     PROCEDURE Color(C:Byte);                  VIRTUAL;
  62.     PROCEDURE CursorDown(N:Byte);             VIRTUAL;
  63.     PROCEDURE CursorLeft(N:Byte);             VIRTUAL;
  64.     PROCEDURE CursorRight(N:Byte);            VIRTUAL;
  65.     PROCEDURE CursorUp(N:Byte);               VIRTUAL;
  66.     PROCEDURE GotoXY(X,Y:Byte);               VIRTUAL;
  67.     PROCEDURE ReadChar(VAR C:Char);           VIRTUAL;
  68.     PROCEDURE SendChar(C:Char);               VIRTUAL;
  69.     PROCEDURE SendString(CONST S:OpenString); VIRTUAL;
  70.     FUNCTION  Waiting:Boolean;                VIRTUAL;
  71.  
  72.     DESTRUCTOR Done; VIRTUAL;
  73.     END;
  74.  
  75.   pLocalIO = ^tLocalIO;
  76.  
  77.   tStatusLine = OBJECT(tID)
  78.  
  79.     Size : ShortInt;      {. . . . . . . .  Size of the status line in rows }
  80.     Text : pChar;         { Text on the status line (color codes are valid) }
  81.  
  82.     CONSTRUCTOR Init(Name:pChar; Sz:ShortInt; Txt:pChar);
  83.     DESTRUCTOR Done; VIRTUAL;
  84.     END;
  85.  
  86.   pStatusLine = ^tStatusLine;
  87.  
  88.   tBBS = RECORD
  89.     Name       : pChar;
  90.     SysopFirst : pChar;
  91.     SysopLast  : pChar;
  92.     END;
  93.  
  94.   tChatCfg = RECORD
  95.     ExecPrompt  : pChar;
  96.     Flags       : Word;
  97.     Greeting    : pChar;
  98.     Goodbye     : pChar;
  99.     RemoteExit  : Boolean;
  100.     SysopColors : tColorScheme;
  101.     UserColors  : tColorScheme;
  102.     END;
  103.  
  104.   tSoftware = RECORD
  105.     Application   : pChar;
  106.     Author        : pChar;
  107.     Build         : STRING[6];
  108.     Company       : pChar;
  109.     Copyright     : pChar;
  110.     Version       : pChar;
  111.     END;
  112.  
  113.   tUser = RECORD
  114.     Expert     : Boolean;
  115.     FirstName  : pChar;
  116.     LastName   : pChar;
  117.     Location   : pChar;
  118.     Password   : pChar;
  119.     PhoneData  : pChar;
  120.     PhoneFax   : pChar;
  121.     PhoneVoice : pChar;
  122.     Security   : LongInt;
  123.     END;
  124.  
  125.  
  126. CONST
  127.  
  128.   { Constants for use with the ChatFlags word }
  129.  
  130.   ChatActive = $01; { .......1 } { . . . . .  Chat-mode is currently active }
  131.   ChatExit   = $02; { ......1. } { . . . . . . . . . . .  Force termination }
  132.  
  133.  
  134. CONST
  135.   Baud           : LongInt    = 0;        { . . . . . . . . Connection rate }
  136.   CarrierDropped : Boolean    = False;    { . . .  TRUE if the user hung up }
  137.   CheckCD        : Boolean    = True;     { . .  Check for dropped carrier? }
  138.   Color1         : Boolean    = True;     { . . . DORINFOx.DEF color kludge }
  139.   ComPort        : Word       = 0;        { . . . . . . Communications port }
  140.   DropFile       : pChar      = NIL;      { . . . .  Path/Name of drop file }
  141.   FOSSILPtr      : pFOSSIL    = NIL;      { . . FOSSIL interface I/O driver }
  142.   FOSSILPort     : Word       = 0;        { . . . . . . . . . . FOSSIL port }
  143.   LocalIOPtr     : pLocalIO   = NIL;      { . . . . . . .  Local I/O driver }
  144.   Locked         : LongInt    = 0;        { . . . . . . .  Locked baud rate }
  145.   MacroFiller    : Char       = ' ';      { . . . .  Fills expanding macros }
  146.   Node           : LongInt    = 0;        { . . . . . . .  Node/line number }
  147.   NoTimeCode     : Byte       = 0;        { .  Returned to DOS when no time }
  148.   StatusShown    : Integer    = -1;       { . .  Index of status line shown }
  149.   TimeOutCode    : Byte       = 0;        { . . . . . Errorlevel if timeout }
  150.  
  151.   BBS : tBBS = (
  152.     Name       : NIL;
  153.     SysopFirst : NIL;
  154.     SysopLast  : NIL );
  155.  
  156.   ChatCfg : tChatCfg = (
  157.     ExecPrompt  : NIL;
  158.     Flags       : 0;
  159.     Greeting    : NIL;
  160.     Goodbye     : NIL;
  161.     RemoteExit  : False;
  162.     SysopColors : ( Lower:03;  Upper:03; Digit:03;  HiBit:03;  Punct:03 );
  163.     UserColors  : ( Lower:07;  Upper:07; Digit:07;  HiBit:07;  Punct:07 ));
  164.  
  165.   Software : tSoftware = (
  166.     Application   : NIL;
  167.     Author        : NIL;
  168.     Build         : '960616';
  169.     Company       : NIL;
  170.     Copyright     : NIL;
  171.     Version       : NIL );
  172.  
  173.   User : tUser = (
  174.     Expert     : False;
  175.     FirstName  : NIL;
  176.     LastName   : NIL;
  177.     Location   : NIL;
  178.     Password   : NIL;
  179.     PhoneData  : NIL;
  180.     PhoneFax   : NIL;
  181.     PhoneVoice : NIL;
  182.     Security   : 0);
  183.  
  184. {#Start}
  185.  
  186. FUNCTION AddSysKey(Code:Word; Source:pChar):Boolean;
  187.   {
  188.   PURPOSE  : Associates a scan code with a string of commands.
  189.  
  190.   NOTES    : Concerto will compare each local keystroke with the list of
  191.              scan codes registered with this function.  The commands
  192.              are executed if a match is found.  A list of common scan
  193.              codes can be found in SYSOP.DOC and KEYBOARD.INT.
  194.  
  195.   EXAMPLE  : BEGIN
  196.              WriteLn('WARNING: The initialization file was not found!');
  197.              WriteLn('         The program will use default values.');
  198.  
  199.              AddSysKey(KB_Alt_C,'Chat');
  200.              AddSysKey(KB_Alt_H,'HangUp Exit 0');
  201.              AddSysKey(KB_Alt_X,'Exit 0');
  202.                :
  203.               etc
  204.                :
  205.              END;
  206.   }
  207.  
  208.  
  209. PROCEDURE CheckLocalMode;
  210.   {
  211.   PURPOSE  : Prompts the sysop for his first and last name if the door
  212.              is operating independently of a BBS system.
  213.  
  214.   NOTES    : The user will not be prompted if any of the following is true:
  215.  
  216.                1. The door is running remotely.
  217.                2. A drop file has been specified.
  218.                3. User.FirstName is not NIL.
  219.                4. User.LastName is not NIL.
  220.  
  221.              If executed, the file LOCAL.ANS is displayed to the caller.
  222.   }
  223.  
  224.  
  225. PROCEDURE DefaultNoTimeProcedure;
  226.   {
  227.   PURPOSE  : Convenience.  Use this procedure if you do not wish to
  228.              write your own no-time-left procedure.
  229.  
  230.   NOTES    : The file EXCEEDED is displayed before terminating the call.
  231.              Add the following to your main program:
  232.  
  233.              SetNoTimeProcedure(@DefaultNoTimeProcedure);
  234.  
  235.   SEE ALSO : SetNoTimeProcedure
  236.   }
  237.  
  238.  
  239. PROCEDURE DefaultTimeOutProcedure;
  240.   {
  241.   PURPOSE  : Convenience.  Use this procedure if you do not wish to
  242.              write your own time-out procedure.
  243.  
  244.   NOTES    : The file TIMEOUT.ANS is displayed before terminating the
  245.              call.  Add the following to your main program:
  246.  
  247.              SetTimeOutProcedure(@DefaultTimeOutProcedure)
  248.  
  249.   SEE ALSO : SetTimeOutProcedure
  250.   }
  251.  
  252.  
  253. PROCEDURE ExitChatMode;
  254.   {
  255.   PURPOSE  : Terminates the chat-mode, if act